import {
  createStore
} from 'vuex'
import persistedState from "vuex-persistedstate"
import user from './modules/user.js'

export default new createStore({
  plugins: [
    persistedState({
      key: "w-music",
      paths: ['user'],
      storage: {
        getItem: key => uni.getStorageSync(key),
        setItem: (key, value) => uni.setStorageSync(key, value),
        removeItem: key => uni.removeStorageSync(key)
      }
    })
  ],
  modules: {
    user
  }
})
